home *** CD-ROM | disk | FTP | other *** search
-
- {
- if(true)
- {
- CWeaponM16 = §§newclass(CWeaponM16,CWeapon);
- }
- }
-
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CWeaponM16 extends CWeapon
- {
-
- public static var _Upgrades:Array = [{
- "mName":"",
- "mAmmo":INFINATEAMMO,
- "mAutoFire":true,
- "mFireRate":SECONDS / 2,
- "mDamage":10,
- "mRange":INFINATERANGE
- }];
-
-
- public function CWeaponM16()
- {
- if(true)
- {
- super();
- if(true)
- {
- mAngleRange = {
- "min":-80,
- "max":80
- };
- if(true)
- {
- mUpgrade = 0;
- if(true)
- {
- mType = "gunm16";
- if(true)
- {
- Process = Process_Normal;
- }
- mAccuracy = 1;
- }
- AddSound("fire_0",Gun_Fire_1);
- }
- AddSound("fire_1",Gun_Fire_2);
- }
- AddSound("fire_2",Gun_Fire_3);
- }
- }
-
- override public function Fire() : void
- {
- var _loc1_:CShot = null;
- if(true)
- {
- super.Fire();
- }
- AddThing(_loc1_ = new CShotBullet(GetShotPosition(),GetShotDelta(),47 + Math.random() * 6,mParent.mCurrentTarget));
- if(mParent.mDrawn)
- {
- AddThing(new CEffectMuzzleFlash(MuzzleFlash_M16,_loc1_.mPosition.Clone(),_loc1_.mDelta));
- }
- PlaySound("fire_" + Math.floor(Math.random() * 3),_loc1_.mPosition);
- IncrementFired();
- }
-
- public function GetShotDelta() : CPosition
- {
- return mParent.GetShotDelta("m16_wp1");
- }
-
- public function GetShotPosition() : CPosition
- {
- return mParent.GetShotPosition("m16_wp1");
- }
-
- override public function get mWeaponName() : String
- {
- return "gunm16";
- }
-
- override public function Draw() : void
- {
- var _loc1_:Point = null;
- var _loc2_:Point = null;
- super.Draw();
- mPosition.Copy(GetShotPosition());
- _loc1_ = GetShotDelta();
- _loc2_ = GetDrawPosition();
- bPlane.fillRect(new Rectangle(_loc2_.x,_loc2_.y,1,1),4294901760);
- bPlane.fillRect(new Rectangle(_loc2_.x + _loc1_.x * 2,_loc2_.y + _loc1_.y * 2,1,1),4278190335);
- }
-
- public function Process_Normal() : void
- {
- if(true)
- {
- WeaponUpdate();
- Process_Children();
- }
- }
-
- override public function get mUpgrades() : Array
- {
- return _Upgrades;
- }
- }
- }
-